project(mainapp)

cmake_minimum_required(VERSION 2.8)

if(CMAKE_BUILD_TYPE STREQUAL Debug)
	set(CMAKE_BUILD_TYPE Debug)
	add_definitions(-DDEBUG)
	message("Debug Compile Project")
	set(by3rd_library_output "${PROJECT_SOURCE_DIR}/3rd/lib" CACHE INTERNAL "3rd Library" )
else()
   set(CMAKE_BUILD_TYPE Release)
	add_definitions(-DNDEBUG)
	message("Release Compile Project")
	set(by3rd_library_output "${PROJECT_SOURCE_DIR}/3rd/lib" CACHE INTERNAL "3rd Library" )
endif()

set(by3rd_library_include   	"${PROJECT_SOURCE_DIR}/3rd/include" CACHE INTERNAL "3rd include" )
#message(${by3rd_library_include})
#message(${PROJECT_SOURCE_DIR}/include)



if (CMAKE_SYSTEM_NAME MATCHES "Android")
	add_definitions("-DANDROID")
	set(UNIX_OS true)
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
	set(UNIX_OS true)
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
	set(UNIX_OS true)
	set(CMAKE_MACOSX_RPATH 0)
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
	set(UNIX_OS true)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
	set(WIN_OS true)
else()
	message(FATAL_ERROR "unknown CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}")
endif()

#add_definitions(-std=c++11)

message("lbycom Info")
message("-- lbycom System = ${CMAKE_SYSTEM_NAME}")
message("-- lbycom Compile = ${CMAKE_BUILD_TYPE}")
add_subdirectory(base)
add_subdirectory(main)
add_subdirectory(comenv)
add_subdirectory(parser)
add_subdirectory(asynio)
add_subdirectory(net)
add_subdirectory(http)
add_subdirectory(bittorrent)
add_subdirectory(webui)
add_subdirectory(mempool)
add_subdirectory(uibase)
